import { http } from '@/api/http'

export interface ILoginParams {
  trancode: string
  userid: string
  userpw: string
}
export interface ILoginRes {
  head: {
    code: string
    [key: string]: string
  },
  [key: string]: any
}
export const login = (params: ILoginParams) => {
  const head = {}
  const fields = {}
  http.setValue(head, 'trancode', params.trancode)
  http.setValue(fields, 'userid', params.userid)
  http.setValue(fields, 'userpw', params.userpw)
  return http.send<ILoginRes>(
    {
      head,
      fields,
      trancode: `?trancode=${params.trancode}`
    }
  )
}